#ifndef HEAPDUMP_H
#define HEAPDUMP_H
#include <QtGlobal>

//works only under Microsoft compiler
void heapdump( bool detail = false );

#if defined(Q_CC_MSVC)
namespace {
    inline void makeUserBreakPoint()
    {
        __asm 
        { 
            int 3; 
        }
    }
}
//call user breakpoint on all exceptions. Microsoft only
#define CATCH_ALL_EXCEPTIONS_BEGIN try { 
#define CATCH_ALL_EXCEPTIONS_END } catch (...) { makeUserBreakPoint(); throw; }

#else//not Q_CC_MSVC 

#define CATCH_ALL_EXCEPTIONS_BEGIN  
#define CATCH_ALL_EXCEPTIONS_END 
   
#endif

#define CATCH_ALL_EXCEPTIONS(x) CATCH_ALL_EXCEPTIONS_BEGIN do { (x); }while(0); CATCH_ALL_EXCEPTIONS_END

#endif


